import java.util.Deque;
import java.util.LinkedList;
import java.util.Scanner;

public class demo03 {
    //拉马车
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = scan.nextLine();
        String b = scan.nextLine();
        Deque<Character> qa = new LinkedList<>();
        Deque<Character> qb = new LinkedList<>();
        Deque<Character> temp = new LinkedList<>();
        for (int i = 0; i < a.length(); i++) {
            qa.addLast(a.charAt(i));
        }
        for (int i = 0; i < b.length(); i++) {
            qb.addLast(b.charAt(i));
        }
        boolean flag = true;
        while (!qa.isEmpty() && !qb.isEmpty()) {
            if (flag) {
                if (temp!=null && temp.contains(qa.peekFirst())) {
                    Character tp = qa.pollFirst();
                    qa.addLast(tp);
                    while (!temp.isEmpty() && temp.peekLast() != tp) {
                        qa.addLast(temp.pollLast());
                    }
                    qa.addLast(temp.pollLast());
                    flag = true;
                } else {
                    temp.addLast(qa.pollFirst());
                    flag = false;
                }
            } else {
                if (temp != null && temp.contains(qb.peekFirst())) {
                    Character tp = qb.pollFirst();
                    qb.addLast(tp);
                    while (!temp.isEmpty() && temp.peekLast() != tp) {
                        qb.addLast(temp.pollLast());
                    }
                    qb.addLast(temp.pollLast());
                    flag = false;
                }else {
                    temp.addLast(qb.pollFirst());
                    flag = true;
                }
            }
        }
        if(qa.isEmpty()){
            while (!qb.isEmpty()){
                System.out.print(qb.pollFirst());
            }
        }else if(qb.isEmpty()){
            while (!qa.isEmpty()){
                System.out.print(qa.pollFirst());
            }
        }
    }
}
